import request from '@/utils/request'

// 查询部门列表
export function listDepartments(query) {
  return request({
    url: '/employee/departments/list',
    method: 'get',
    params: query
  })
}

// 查询部门
export function optionDepartments() {
  return request({
    url: '/employee/departments/option',
    method: 'get',
  })
}

// 查询部门详细
export function getDepartments(id) {
  return request({
    url: '/employee/departments/' + id,
    method: 'get'
  })
}

// 新增部门
export function addDepartments(data) {
  return request({
    url: '/employee/departments',
    method: 'post',
    data: data
  })
}

// 修改部门
export function updateDepartments(data) {
  return request({
    url: '/employee/departments',
    method: 'put',
    data: data
  })
}

// 删除部门
export function delDepartments(id) {
  return request({
    url: '/employee/departments/' + id,
    method: 'delete'
  })
}
